import { UP_DOWN_SHELVES_OPTIONS, IMAGE_TEXT_STATE_OPTIONS } from '@/constants/commodity';
import { getUserInfoListService, getDepartmentsService } from '@/api/usercenter';
import { getAllBrandListService } from '@/api/commodity/common';
export const FORM_ITEMS = [
  {
    prop: 'categoryUuids',
    label: '四级类名称',
    type: 'slot',
    slotName: 'category',
    defaultVal: []
  },
  {
    prop: 'skuNo',
    label: 'SKU编码',
    type: 'input',
  },
  {
    prop: 'brandUuid',
    label: '品牌',
    type: 'select',
    remote: true,
    remoteMethod: getAllBrandListService,
    paramKey: 'brandName',
    optionKeys: { valueKey: 'brandUuid', labelKey: 'brandName' },
  },
  {
    prop: 'productName',
    label: '商品名称',
    type: 'input',
  },
  {
    prop: 'createOper',
    label: '创建人',
    type: 'select',
    remote: true,
    remoteMethod: getUserInfoListService,
    paramKey: 'userName',
    optionKeys: { valueKey: 'userIdStr', labelKey: 'userName', codeKey: 'jobNumber' },
  },
  {
    prop: 'operDeptUuid',
    label: '创建人部门',
    type: 'select',
    remote: true,
    remoteMethod: getDepartmentsService,
    paramKey: 'departmentName',
    optionKeys: { valueKey: 'departmentId', labelKey: 'departmentName' },
  },
  {
    prop: 'createOpeTime',
    label: '创建时间',
    type: 'datePicker',
    datePickerType: 'daterange',
    valueFormat: 'yyyy-MM-dd',
  },
  {
    prop: 'state',
    label: '上下架状态',
    type: 'select',
    options: UP_DOWN_SHELVES_OPTIONS,
  },
  {
    prop: 'imageStatus',
    label: '图文完善状态',
    type: 'select',
    clearable: true,
    options: IMAGE_TEXT_STATE_OPTIONS,
  },
]

export const TABLE_COLUMNS = [
  {
    title: '单据号',
    key: 'recordNo',
  },
  {
    title: '创建人',
    key: 'creatorName',
    width: 80
  },
  {
    title: '创建时间',
    key: 'createOpeTime',
  },
  {
    title: '部门',
    key: 'operDeptName',
    width: 90
  },
  {
    title: '公司',
    key: 'hrCompanyName',
  },
  {
    title: '商品负责人',
    key: 'productOwnerName'
  },
  {
    title: '商品管理区域',
    key: 'manageAreaName'
  },
  {
    title: '上下架状态',
    key: 'upStateStr',
  },
  {
    title: '四级类代码',
    key: 'categoryNo',
  },
  {
    title: '四级类名称',
    key: 'categoryName',
  },
  {
    title: 'SKU编码',
    key: 'skuNo',
    width: 90
  },
  {
    title: '品牌',
    key: 'brandName',
  },
  {
    title: '商品名称',
    key: 'productName',
  },
  {
    title: '规格',
    key: 'specModel',
  },
  {
    title: '计量单位',
    key: 'unitName',
    width: 80
  },
  {
    title: '订货次数',
    key: 'orderFrequency'
  },
  {
    title: '订货数量',
    key: 'orderQuantity'
  },
  {
    title: '订货成本',
    key: 'orderAmount'
  },
  {
    title: '成本价',
    key: 'costPrice',
    width: 80
  },
  {
    title: '售价',
    key: 'sellPrice',
    width: 100
  },
  {
    title: '售卖平台',
    key: 'salePlatStr',
    width: 80
  },
  {
    title: '销售区域',
    key: 'saleAreaStr',
    width: 80
  },
  {
    title: '图文完善状态',
    key: 'imageStatusStr',
  },
  {
    title: '是否紧急订货',
    key: 'emergencyOrderStr',
  }
]
